package com.plian.system.entity.qg.guarantee;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 企业担保申请主表实体类
 *
 * @author jianglei
 * @since 2019-10-23
 */
@Data
@TableName("qg_property_guarantee_apply")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "PropertyGuaranteeApply对象", description = "企业担保申请主表")
public class PropertyGuaranteeApply extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/**
	* 单据编码
	*/
	@ApiModelProperty(value = "单据编码")
		private String code;


	/**
	* 申请日期
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
	@TableField(value = "apply_date",updateStrategy = FieldStrategy.IGNORED)
	@ApiModelProperty(value = "申请日期", required = true)
		private Date applyDate;
	/**
	* 申请公司名称
	*/
	@ApiModelProperty(value = "申请公司名称 单位id", required = true)
		private String applyNameId;
	/**
	* 企业级次
	*/
	@ApiModelProperty(value = "企业级次 编码001")
		private String unitRankId;
	/**
	* 担保名称
	*/
	@ApiModelProperty(value = "担保名称", required = true)
		private String guaranteeName;
	/**
	* 请示文号
	*/
	@ApiModelProperty(value = "请示文号", required = true)
		private String askDocNumber;
	/**
	* 董事会日期
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
	@TableField(value = "board_date",updateStrategy = FieldStrategy.IGNORED)
	@ApiModelProperty(value = "董事会日期", required = true)
		private Date boardDate;
	/**
	* 董事会决议简要情况
	*/
	@ApiModelProperty(value = "董事会决议简要情况")
		private String boardMeetingDetail;

	/**
	 * 担保人
	 */
	@ApiModelProperty(value = "担保人 单位id", required = true)
	private String guaranteeCompanyId;

	/**
	 * 被担保人
	 */
	@ApiModelProperty(value = "被担保人", required = true)
	private String warranteeCompanyName;

	/**
	* 担保金额
	*/
	@ApiModelProperty(value = "担保金额(万元)", required = true)
		private BigDecimal guaranteeAmount;
	/**
	* 累计担保额
	*/
	@ApiModelProperty(value = "累计担保额(万元)")
		private BigDecimal guaranteeTotal;
	/**
	* 剩余担保金额
	*/
	@ApiModelProperty(value = "剩余担保金额(万元)")
		private BigDecimal guaranteeRemain;
	/**
	* 担保方式
	*/
	@ApiModelProperty(value = "担保方式 编码050", required = true)
		private String guaranteeModeId;
	/**
	* 担保责任
	*/
	@ApiModelProperty(value = "担保责任 编码051")
		private String guaranteeDutyId;
	/**
	* 有效担保起始日
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
	@TableField(value = "guarantee_start_date",updateStrategy = FieldStrategy.IGNORED)
	@ApiModelProperty(value = "有效担保起始日")
		private Date guaranteeStartDate;
	/**
	* 有效担保终止日
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
	@TableField(value = "guarantee_end_date",updateStrategy = FieldStrategy.IGNORED)
	@ApiModelProperty(value = "有效担保终止日")
		private Date guaranteeEndDate;

	/**
	* 担保期限
	*/
	@ApiModelProperty(value = "担保期限(月)", required = true)
	private Integer guaranteeLimit;

	/**
	* 累计借款额
	*/
	@ApiModelProperty(value = "累计借款额(万元)")
		private BigDecimal totalLoanAmount;
	/**
	* 借款用途
	*/
	@ApiModelProperty(value = "借款用途", required = true)
		private String loanUsage;
	/**
	* 借款资金种类
	*/
	@ApiModelProperty(value = "借款资金种类 编码052",required = true)
		private String loanTypeId;

	/**
	* 借款性质
	*/
	@ApiModelProperty(value = "借款性质 编码053", required = true)
		private String loanNatureId;
	/**
	* 还款计划
	*/
	@ApiModelProperty(value = "还款计划说明", required = true)
		private String loanPlan;
	/**
	* 还款资金来源
	*/
	@ApiModelProperty(value = "还款资金来源", required = true)
		private String loanSource;
	/**
	* 批复日期
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
	@TableField(value = "reply_date",updateStrategy = FieldStrategy.IGNORED)
	@ApiModelProperty(value = "批复日期", required = true)
		private Date replyDate;
	/**
	* 批复名称
	*/
	@ApiModelProperty(value = "批复名称", required = true)
		private String replyName;
	/**
	* 批复文号
	*/
	@ApiModelProperty(value = "批复文号", required = true)
		private String replyDocNumber;
	/**
	* 版本号
	*/
		private String version;
	/**
	* 备注
	*/
	@ApiModelProperty(value = "备注")
		private String remark;
	/**
	* 审批人
	*/
		private String approvedUser;
	/**
	* 审批时间
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
		private Date approvedTime;
	/**
	* 审批意见
	*/
		private String approvedOpinion;
	/**
	* 乐观锁字段
	*/
		private Integer tsVersion;
	/**
	* 审批流主键
	*/
		private String formType;
	/**
	* 备选1
	*/
		private String def1;
	/**
	* 备选2
	*/
		private String def2;
	/**
	* 备选3
	*/
		private String def3;
	/**
	* 备选4
	*/
		private String def4;
	/**
	* 备选5
	*/
		private String def5;
	/**
	* 备选6
	*/
		private String def6;
	/**
	* 备选7
	*/
		private String def7;
	/**
	* 备选8
	*/
		private String def8;
	/**
	* 备选9
	*/
		private BigDecimal def9;
	/**
	* 备选10
	*/
		private BigDecimal def10;
	/**
	* 备选11
	*/
		private BigDecimal def11;
	/**
	* 备选12
	*/
		private BigDecimal def12;
	/**
	* 备选13
	*/
		private BigDecimal def13;
	/**
	* 备选14
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
		private Date def14;
	/**
	* 备选15
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
		private Date def15;
	/**
	* 备选16
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
		private Date def16;
	/**
	* 备选17
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
		private Date def17;
	/**
	* 备选18
	*/
	@JsonSerialize(using = ToStringSerializer.class)
		private Long def18;
	/**
	* 备选19
	*/
	@JsonSerialize(using = ToStringSerializer.class)
		private Long def19;
	/**
	* 备选20
	*/
	@JsonSerialize(using = ToStringSerializer.class)
		private Long def20;


	/**
	 * 担保人上年末经审计的数据
	 */
	@TableField(exist = false)
	private List<PropertyGuaranteeAudit> propertyGuaranteeAudits;

	/**
	 * 被担保人上年末经审计的数据
	 */
	@TableField(exist = false)
	private List<PropertyGuaranteeWarrantee> propertyGuaranteeWarrantees;

	/**
	 * 数据来源 null为系统填报 对应用户id
	 */
	@ApiModelProperty(value = "数据来源 null为系统填报 对应用户id")
	private String dataSource;

	/**
	 * 数据来源id
	 */
	@ApiModelProperty(value = "数据来源id", required = true)
	private String dataSourceId;

}
